<template>
	<div class="quartz-joblog-dialog-container">
		<el-dialog :title="state.dialog.title" v-model="state.dialog.isShowDialog" width="769px">
			<el-form :model="form" label-width="100px">
				<el-row>
					<el-col :span="12">
						<el-form-item label="日志序号：">{{ state.ruleForm.id }}</el-form-item>
						<el-form-item label="任务名称：">{{ state.ruleForm.name }}</el-form-item>
					</el-col>
					<el-col :span="12">
						<el-form-item label="任务分组：">{{ state.ruleForm.jobGroup }}</el-form-item>
						<el-form-item label="执行时间：">{{ state.ruleForm.createDate }}</el-form-item>
					</el-col>
					<el-col :span="24">
						<el-form-item label="调用方法：">{{ state.ruleForm.invokeTarget }}</el-form-item>
					</el-col>
					<el-col :span="24">
						<el-form-item label="日志信息：">{{ state.ruleForm.jobMessage }}</el-form-item>
					</el-col>
					<el-col :span="24">
						<el-form-item label="执行状态：">
							<div v-if="state.ruleForm.status == 0">正常</div>
							<div v-else-if="state.ruleForm.status == 1">失败</div>
						</el-form-item>
					</el-col>
					<el-col :span="24">
						<el-form-item label="异常信息：" v-if="state.ruleForm.status == 1">{{ state.ruleForm.exceptionInfo }}</el-form-item>
					</el-col>
				</el-row>
			</el-form>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="closeDialog">关 闭</el-button>
				</div>
			</template>
		</el-dialog>
	</div>
</template>

<script setup lang="ts" name="quartzJoblogDialog">
import { joblogApi } from '/@/api/monitor/quartz/jobLog';


// 定义变量内容
const state = reactive({
	ruleForm: {} as JoblogType,
	dialog: {
		isShowDialog: false,
		type: '',
		title: '',
		submitTxt: '',
	},
});

// 打开弹窗
const openDialog = (row: JoblogType) => {
	state.dialog.isShowDialog = true;
	state.ruleForm = row;
};
// 关闭弹窗
const closeDialog = () => {
	state.dialog.isShowDialog = false;
};

// 暴露变量
defineExpose({
	openDialog,
});
</script>
